package com.hornsun.data.repository.mapper;

import com.hornsun.data.dbo.Organization;
import com.hornsun.data.dbo.OrganizationExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;

public interface OrganizationMapper {
    long countByExample(OrganizationExample example);

    int deleteByExample(OrganizationExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Organization record);

    int insertSelective(Organization record);

    List<Organization> selectByExampleWithRowbounds(OrganizationExample example, RowBounds rowBounds);

    List<Organization> selectByExample(OrganizationExample example);

    Organization selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Organization record, @Param("example") OrganizationExample example);

    int updateByExample(@Param("record") Organization record, @Param("example") OrganizationExample example);

    int updateByPrimaryKeySelective(Organization record);

    int updateByPrimaryKey(Organization record);

    //获取最大id的值
    int selectMaxId();

    //根据pid获取子节点的最大indexs值
    long selectMaxIndexs(int pid);

    //序列递减(无终点)
    void indexReduce(@Param("pid")int pid , @Param("indexs")int indexs);

    //序列递增(无终点)
    void indexAdd (@Param("pid")int pid , @Param("indexs")int indexs);

    //序列递增（有起点终点）
    void indexAddOver(@Param("pid")int pid , @Param("startIndex")int startIndex , @Param("overIndex")int overIndex);

    //序列递减(有起点终点)
    void indexReduceOver(@Param("pid")int pid , @Param("startIndex")int startIndex , @Param("overIndex")int overIndex);

}